package com.szq.day39.controller;


import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class DoAllException {
	@ExceptionHandler
	public ModelAndView doException(Exception ex){
		System.out.println("DoAllException");
		ModelAndView mv = new ModelAndView("/error");
		String code = ex.getMessage();
		mv.addObject("code", code);
		return mv;
	}

}
